var oldValue = '';
$(document).ready(function(){
    $("#confirm").click(function(){
       var value = $("#fankui").val();
       if (!value) {
        return notify('请输入正确的内容');
       }

       request(value);
    });
    $("#fankui").keyup(function(v){
        var newValue = $("#fankui").val();
        if (newValue.length <= 200) {
            oldValue = newValue;
            $("#text_length").html(newValue.length)
        } else {
            $("#fankui").val(oldValue);
        }
    });

});
function request(content) {
    $.ajax({
        type: "POST",//方法类型
        dataType: "json",//预期服务器返回的数据类型
        url: "/index.php/Home/Info/lianxius/" ,//url
        data: {'lynr': content},
        success: function (result) {
            if (result.code==1) {
                notify(result.msg);
                window.location.href='/index.php/Home/Info/myziliao/';
            }else{
                notify(result.msg);
            }
        },
        error : function() {
            notify("异常！");
        }
    });
}